<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let arr2=[19,34,66,12,65]
        let arr1=[1,2,3,4,5]
        function are(a,b=true) {
            let sum =0
            for(i=0;i<a.length;i++){
                sum+=a[i]
            }
            // console.log(sum);
            if(b===false){
                let pjz=sum/a.length
                return `和：${sum}平均值：${pjz}`
            }else{
                return sum
            }
        }
        let arc = are(arr1,false)
        let arb = are(arr2,true)
        document.write(arb)
    </script>
</body>
</html>